// Command 接口
interface Command {
    void execute();
}

// Receiver 类
class Receiver {
    public void action() {
        System.out.println("Receiver action");
    }
}

// Invoker 类
class Invoker {
    public void storeAndExecute(Command command) {
        command.execute();
    }
}

// ConcreteCommand 类
class ConcreteCommand implements Command {
    private Receiver receiver;

    public ConcreteCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        receiver.action();
    }
}

// 测试类
public class CommandTest {
    public static void main(String[] args) {
        Receiver receiver = new Receiver();
        Command command = new ConcreteCommand(receiver);
        Invoker invoker = new Invoker();

        invoker.storeAndExecute(command); // 输出：Receiver action
    }
}